Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Accessing Types in a Class

QuickDraw 3D provides routines for accessing various object types. The types are defined as follows:

typedef struct TQ3ObjectClassPrivate    *TQ3XObjectClass;

Q3XObjectClass_GetType

You can use the Q3XObjectClass_GetType function to get the type, given a reference to a class. This is most useful in the instance where you register an element or attribute and need to get the type. When you register an element, QuickDraw 3D will take the type you pass in and modify it, to avoid name conflicts. Many object system calls require an object type; this function lets you get the type from the class reference that you ordinarily store when you register a class.

TQ3Status Q3XObjectClass_GetType(
                     TQ3XObjectClass    objectClass,
                     TQ3ObjectType      *type);
objectClass
A class.
type
On return, an object type.

DESCRIPTION

The Q3XObjectClass_GetType function returns, in the type parameter, the type of the class referenced by objectClass.

Q3XObjectClass_GetLeafType

The Q3XObjectClass_GetLeafType function lets you determine the leaf type of a class.

TQ3ObjectType Q3XObjectClass_GetLeafType(
                     TQX3ObjectClass    objectClass);
objectClass
An object class.

DESCRIPTION

The Q3XObjectClass_GetLeafType function returns the leaf type of a class. If an error occurs, it returns kQ3ObjectTypeInvalid and posts an error.

Q3XObjectClass_GetSubClassType

The Q3XObjectClass_GetSubClassType function lets you determine the subclass type of one object class relative to another object class.

TQ3ObjectType Q3XObjectClass_GetSubClassType(
                     TQX3ObjectClass    objectClass,
                     TQX3ObjectClass    targetObjectClass);
objectClass
First object class.
targetObjectClass
Second object class.

DESCRIPTION

The Q3XObjectClass_GetSubClassType function is used for _GetType calls in a particular class. For example, Q3Geometry_GetType would be implemented

TQ3ObjectType Q3Geometry_GetType (TQ3GeometryObject object)
    {
    return Q3XObject_GetSubClassType (gGeometryClass, object);
    }

where gGeometryClass is the geometry object class, and object is a subclass of the geometry class. The type returned is the subclass type of the geometry.

If an error occurs, the Q3XObjectClass_GetSubClassType function returns kQ3ObjectTypeInvalid and posts an error.

Q3XObject_GetClass

You can use the Q3XObject_GetClass function to get the class of an object.

TQ3XObjectClass Q3XObject_GetClass(
                     TQ3Object    object);
object
An object.

DESCRIPTION

The Q3XObject_GetClass function returns the class of the object designated by object.

Q3XObject_GetSubClassType

The Q3XObject_GetSubClassType function lets you determine the subclass type of an object relative to an object class.

TQ3ObjectType Q3XObject_GetSubClassType(
                     TQ3XObjectClass    objectClass,
                     TQ3XObject          targetObject);
objectClass
An object class.
targetObject
An object.

DESCRIPTION

Use of Q3XObject_GetSubClassType resembles Q3XObjectClass_GetSubClassType (link) , except it is used for an object relative to an object class instead of for two object classes.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |